Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

[16.0][MIG] sale_variant_configurator: Migration to version 16.0 #353

Merged
merged 21 commits into from
Jun 22, 2024

Conversation

carolinafernandez-tecnativa
Copy link

@carolinafernandez-tecnativa carolinafernandez-tecnativa commented May 16, 2024

  • Standard migration from 13 to 16.

@Tecnativa
TT46599

@pedrobaeza @pilarvargas-tecnativa

pedrobaeza and others added 20 commits May 16, 2024 19:03
This comes from module sale_product_variants from odoomrp/odoomrp-wip.
- saleable products for Sale Orders.
- purchable products for Purchase Orders.
Depending on the onchange order loaded in runtime, description put in the SO line
might be the one got from the regular way. With this, we assure we get the proper
description, and also in the partner language (using the trick with the partner field).
* Use generic method for creating the variant if needed
* Create the variant when the sales is already confirmed
for some reason, after the creation of the product, the sale.order.line
was emptied (e.g. product_tmpl_id was False) -> the onchange would do nothing.

I split the test in two, and in the second test, I create the product before
creating the sale order line.
…omer language

As the model `sale.order.line` doesn't have `partner_id` field, the
description is not populated in the customer language, as the automatism
put in product_configurator makes use of this trick.

For not adding such field that can conflict with other parts, let's
overwrite the methods that populate the description and pass upstream
the customer language in the context.

TT33029
@carolinafernandez-tecnativa carolinafernandez-tecnativa force-pushed the 16.0-mig-sale_variant_configurator branch from 24ce980 to 3abf68d Compare May 30, 2024 15:53
@pedrobaeza
Copy link
Member

On v16, AFAIK, there are no more onchanges in sale.order.line. All are computed writable fields, so you shouldn't insist in making this to work with onchanges, but to adapt the mechanism overriding computed methods.

@carolinafernandez-tecnativa carolinafernandez-tecnativa force-pushed the 16.0-mig-sale_variant_configurator branch 2 times, most recently from ea65719 to 75bf84c Compare May 31, 2024 12:05
@carolinafernandez-tecnativa
Copy link
Author

On v16, AFAIK, there are no more onchanges in sale.order.line. All are computed writable fields, so you shouldn't insist in making this to work with onchanges, but to adapt the mechanism overriding computed methods.

On v16, AFAIK, there are no more onchanges in sale.order.line. All are computed writable fields, so you shouldn't insist in making this to work with onchanges, but to adapt the mechanism overriding computed methods.

The only one missing was _compute_name, could you please check it now?

@victoralmau victoralmau force-pushed the 16.0-mig-sale_variant_configurator branch 4 times, most recently from 052e9f7 to 511e6a6 Compare June 18, 2024 07:01
@rousseldenis
Copy link

/ocabot migration sale_variant_configurator

@OCA-git-bot OCA-git-bot added this to the 16.0 milestone Jun 18, 2024
@OCA-git-bot OCA-git-bot mentioned this pull request Jun 18, 2024
9 tasks
@@ -48,6 +49,7 @@ class ProductConfigurator(models.AbstractModel):
)
def _compute_can_be_created(self):
for rec in self:
rec.price_extra = sum(rec.mapped("product_attribute_ids.price_extra"))
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

A computed can't assign other value outside of their definition.

@victoralmau victoralmau force-pushed the 16.0-mig-sale_variant_configurator branch from 511e6a6 to 2351a7b Compare June 21, 2024 06:45
Copy link
Member

@pedrobaeza pedrobaeza left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

/ocabot merge nobump

@OCA-git-bot
Copy link
Contributor

Hey, thanks for contributing! Proceeding to merge this for you.
Prepared branch 16.0-ocabot-merge-pr-353-by-pedrobaeza-bump-nobump, awaiting test results.

@OCA-git-bot OCA-git-bot merged commit e128707 into OCA:16.0 Jun 22, 2024
5 checks passed
@OCA-git-bot
Copy link
Contributor

Congratulations, your PR was merged at 652eb8d. Thanks a lot for contributing to OCA. ❤️

@pedrobaeza pedrobaeza deleted the 16.0-mig-sale_variant_configurator branch June 22, 2024 08:23
sbidoul added a commit to acsone/product-variant that referenced this pull request Aug 2, 2024
…lly bump versions

Changes have been merged with nobump in PR OCA#353
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

Successfully merging this pull request may close these issues.